# Maintainer: Patrick Gansterer <paroga@paroga.com>
pkgname=thrift
pkgver=0.13.0
pkgrel=0
pkgdesc="Language-independent software stack for RPC implementation"
url="https://thrift.apache.org/"
arch="all !armhf" # multiple failing tests
license="Apache-2.0"
makedepends="autoconf automake bison boost-dev boost-static flex
	libevent-dev libtool openssl-dev zlib-dev"
subpackages="$pkgname-libs-cpp:libscpp $pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/apache/thrift/archive/v$pkgver.tar.gz
	missing-signal-h.patch
	"

prepare() {
	default_prepare
	./bootstrap.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--without-python \
		--without-py3 \
		--disable-tutorial
	make
}

check() {
	make -k check
}

package() {
	make DESTDIR="$pkgdir" install
}

libscpp() {
	pkgdesc="Thrift C++ library"

	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/*-*.so "$subpkgdir"/usr/lib
}

sha512sums="1c310f87836c5da16964cff6ab463db00e86a0ba3dd978f601f042eb92a393abca5cd56602bf63e912e2a9b4b6ebfd1b16c1bf578e3f48e0769108cff2dc2f6d  thrift-0.13.0.tar.gz
72db52532e03ab2c8bca03f61b427632eb0f7bf0bb29a2e90f2fab2a3775d589791083848236ed88b23eecb8c6a134b335669997df66f11483f2b614d946bd5b  missing-signal-h.patch"
